//package com.tongfutele;
//
//import org.apache.log4j.PropertyConfigurator;
//
//import javax.servlet.ServletContext;
//import javax.servlet.ServletContextEvent;
//import javax.servlet.ServletContextListener;
//import javax.servlet.annotation.WebListener;
//import java.io.File;
//
//@WebListener("application context listener")
//public class ContextListener implements ServletContextListener {
//    @Override
//    public void contextInitialized(ServletContextEvent servletContextEvent) {
//        // initialize log4j here<font></font>
//        ServletContext context = servletContextEvent.getServletContext();
//        String log4jConfigFile = context.getInitParameter("log4j-config-location");
//        String fullPath = context.getRealPath("") + File.separator + log4jConfigFile;
//        PropertyConfigurator.configure(fullPath);
//    }
//
//    @Override
//    public void contextDestroyed(ServletContextEvent servletContextEvent) {
//
//    }
//}
